﻿namespace Vdc.Grid
{
    using System;
    using System.ComponentModel;
    using System.Web.UI;

    [PersistChildren(false), ParseChildren(true)]
    public class CheckBoxColumn : Column, ICloneable
    {
        public CheckBoxColumn()
        {
            base.Width = "60";
        }

        public object Clone()
        {
            return new CheckBoxColumn { 
                Align = base.Align, AllowDelete = base.AllowDelete, AllowEdit = base.AllowEdit, AllowFilter = base.AllowFilter, AllowGroupBy = base.AllowGroupBy, AllowSorting = base.AllowSorting, ApplyFormatInEditMode = this.ApplyFormatInEditMode, ControlType = this.ControlType, DataField = this.DataField, DataFormatString = this.DataFormatString, DataFormatString_GroupHeader = base.DataFormatString_GroupHeader, ExportAsText = base.ExportAsText, GroupBy = base.GroupBy, GroupByPriority = base.GroupByPriority, HeaderAlign = base.HeaderAlign, HeaderText = this.HeaderText, 
                HtmlEncode = this.HtmlEncode, Index = base.Index, ParseHTML = base.ParseHTML, ReadOnly = this.ReadOnly, ShowFilterCriterias = base.ShowFilterCriterias, ShowHeader = this.ShowHeader, SortExpression = this.SortExpression, SortOrder = base.SortOrder, SortPriority = base.SortPriority, Visible = base.Visible, Width = base.Width, Wrap = base.Wrap, TemplateSettings = base.TemplateSettings.Clone() as ColumnTemplateSettings
             };
        }

        object ICloneable.Clone()
        {
            return this.Clone();
        }

        [Bindable(true), DefaultValue(1), Description("Gets or sets a value indicating the type of the control used by the column."), Category("Column Settings")]
        public GridControlType ControlType
        {
            get
            {
                object obj2 = base.ViewState["ControlType"];
                if (obj2 != null)
                {
                    return (GridControlType) obj2;
                }
                return GridControlType.Vdc;
            }
            set
            {
                base.ViewState["ControlType"] = value;
            }
        }
    }
}

